import "package:flutter/material.dart";
import "package:myapp/_widget/swiper.dart";

class LiveSwiperWidget extends StatelessWidget {
  const LiveSwiperWidget({super.key});
  @override
  Widget build(BuildContext context) {
    return SliverToBoxAdapter(
      child: AspectRatio(
        aspectRatio: 3 / 1,
        child: Padding(
          padding: const EdgeInsets.all(5),
          child: ClipRRect(
            borderRadius: BorderRadius.circular(4),
            child: LayoutBuilder(
              builder: (context, constraints) {
                return Swiper(
                    showIndicator: true,
                    indicatorMainAxisAlignment: MainAxisAlignment.end,
                    indicatorRadius: 6,
                    indicatorInactiveColor: Colors.white,
                    indicatorActiveColor:
                        const Color.fromARGB(255, 244, 52, 116),
                    height: constraints.maxHeight,
                    onCurrentIndexChange: (val) {},
                    animatedDuration: const Duration(milliseconds: 100),
                    duration: const Duration(milliseconds: 2500),
                    auto: true,
                    loop: true,
                    children: [
                      Image.asset(
                        "./images/1.jpg",
                        fit: BoxFit.cover,
                      ),
                      Image.asset(
                        "./images/3.jpg",
                        fit: BoxFit.cover,
                      ),
                    ]);
              },
            ),
          ),
        ),
      ),
    );
  }
}
